package com.ss.test01;

import java.net.InetAddress;
import java.net.InetSocketAddress;

/**
 * @Auther: 520ljs
 * @Date: 2022/3/20 - 03 - 20 - 22:15
 */
public class Test02 {
    //这是一个main方法，是程序的入口
    public static void main(String[] args) {
        InetSocketAddress isa = new InetSocketAddress("172.19.7.115",8080);
        System.out.println(isa);
        System.out.println(isa.getHostName());
        System.out.println(isa.getPort());

        InetAddress ia = isa.getAddress();
        System.out.println(ia.getHostName());
        System.out.println(ia.getHostAddress());
    }
}
